<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>微信分享</title>
</head>
<body>
<input type="hidden" value="{$noncestr}" id="noncestr"/>
<input type="hidden" value="{$timestamp}" id="timestamp"/>
<input type="hidden" value="{$signature}" id="signature" />
</body>
<!--引入微信分享在线cdn的js-->
<script src="//cdn.66173.cn/www/js/jquery-1.8.3.min.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script>
    // <!--获取到签名-->
    var noncestr = $("#noncestr").val();
    var timestamp = $("#timestamp").val();
    // var timestamp = Date.parse(new Date());
    var signature = $("#signature").val();
    console.log(parseInt(timestamp))
    document.addEventListener('WeixinJSBridgeReady', function() {
        wx.config({
            debug: true,
            appId: "wxbaed68c7f2f3a62c",// 必填，公众号的唯一标识
            timestamp: parseInt(timestamp),// 必填，生成签名的时间戳
            nonceStr: noncestr,// 必填，生成签名的随机串
            signature: signature,// 必填，签名
            jsApiList: [
                'onMenuShareTimeline',
                'onMenuShareAppMessage',
                'onMenuShareQQ',
                'onMenuShareWeibo',
                'onMenuShareQZone'
            ]
        });
        console.log(timestamp+9999)
        //这里是分享代码
        wx.ready(function() {
            var shareData = {
                title: '93游戏',
                desc: '牛果游戏是一个致力于提供优质手游的应用平台。实时同步市场热门手游,与玩家一起发现精品游戏,享受真福利与真特权，只为带给您高品质的游戏体验。',
                link: window.location.href,
                imgUrl: "http://cdn.66173.cn/niuguo/img/icon.png?t=11",// 分享图标
                type: '',
                dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
                success: function() {
                    briefTipControl("分享成功");
                    alert("分享成功1")
                },
                cancel: function() {
                    briefTipControl("您已取消分享");
                }
            };
            // 分享给朋友事件绑定
            wx.onMenuShareAppMessage(shareData);
            // 分享到朋友圈
            wx.onMenuShareTimeline(shareData);
            // 分享到QQ
            wx.onMenuShareQQ(shareData);
            // 分享到QZone
            wx.onMenuShareQZone(shareData);
            // 分享到微博
            wx.onMenuShareWeibo(shareData);
        });
    });
</script>
<!--底部结束了-->
</html>